package lab02.test23;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;
import java.util.SimpleTimeZone;

/**
 * Created by 唐苗苗 on 2017/11/1.
 */


public class Test {
    public static void main(String[] args) throws ParseException {
       //1.请输入生日
       //2.生日还有几天
        //4天 = 生日日期-当前日期
        //（time = time2）/(24*60*60*1000)
        //日期->整数？？？
        //Calendar  日历
        Scanner scanner=new Scanner(System.in);
        String birthday;
        birthday =scanner.nextLine();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd");
        Calendar calendar=Calendar.getInstance();
        long time1=0;
        long time2=0;

        calendar.setTime(simpleDateFormat.parse(birthday));
       // time1=calendar.get(Calendar.YEAR);
        time1=calendar.getTimeInMillis();
        calendar.setTime(simpleDateFormat.parse("2017-11-02"));
        time2=calendar.getTimeInMillis();
       // time2=calendar.get(Calendar.YEAR);
        System.out.println("相差的天数是:"+(time1-time2)/(24*60*60*1000));

    }
}
